.TH std::regex_iterator::operator*,operator-> 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::regex_iterator::operator*,operator-> \- std::regex_iterator::operator*,operator->

.SH Synopsis
   const value_type& operator*() const;  \fB(1)\fP \fI(since C++11)\fP
   const value_type* operator->() const; \fB(2)\fP \fI(since C++11)\fP

   Extracts the current std::match_results from a regex_iterator.

.SH Return value

   1) Returns a reference to the current std::match_results.
   2) Returns a pointer to the current std::match_results.

.SH Example


// Run this code

 #include <iostream>
 #include <regex>
 #include <string>

 int main()
 {
     std::string hay{"1.1a2b3cjk34"};
     std::regex needle("[1234]");
     using Ri = std::regex_iterator<std::string::iterator>;
     for (Ri it{hay.begin(), hay.end(), needle}, last{}; it != last; ++it)
         std::cout << it->str();
     std::cout << '\\n';
 }

.SH Output:

 112334
